
<?php //echo $this->Form->create('Rating',array('url'=>array('plugin'=>'article','controller'=>'article','action'=>'view',$article_id),'class'=>'rating_form','id'=>"rating_".$article_id))?>
<?php echo $this->Form->create('Rating',array('url'=>Router::url( $this->here, true )))?>
<?php echo $this->Form->hidden('Article.Article.0',array('value'=>$article_id))?>
	<fieldset>
		<h3 class="required"><?php echo __d('competitions','Title of your review',true)?><after></h3>
		<div class="form_text">
			<?php echo $this->Form->input('Comment.title',array('size'=>"40", 'class'=>"form_question",'div'=>false,'label'=>false))?>			
        </div>
        <h3><?php echo __d('competitions','Your review',true)?></h3>
        <div class="form_textarea">        	
        	<textarea name="data[Comment][content]" class="form_question_content"></textarea>
        </div>                            
		<div class='clear'>&nbsp;</div>	
		       
		<h3><?php echo __d('competitions','Click to select a rating',true)?></h3>	                                
		<ul class="rating-list">
		<?php foreach ($rating as $key => $r) {?>
			<li>		
				
					<input name="data[RatingValue][<?php echo $r['Rating']['id']?>]" type="radio" class="star<?php echo $r['Rating']['id']?>" value="1" title="<?php echo __d('competitions','Terrible',true)?>"/>
					<input name="data[RatingValue][<?php echo $r['Rating']['id']?>]" type="radio" class="star<?php echo $r['Rating']['id']?>" value="2" title="<?php echo __d('competitions','Poor',true)?>"/>
					<input name="data[RatingValue][<?php echo $r['Rating']['id']?>]" type="radio" class="star<?php echo $r['Rating']['id']?>" value="3" title="<?php echo __d('competitions','Average',true)?>"/>
					<input name="data[RatingValue][<?php echo $r['Rating']['id']?>]" type="radio" class="star<?php echo $r['Rating']['id']?>" value="4" title="<?php echo __d('competitions','Very Good',true)?>"/>
					<input name="data[RatingValue][<?php echo $r['Rating']['id']?>]" type="radio" class="star<?php echo $r['Rating']['id']?>" value="5" title="<?php echo __d('competitions','Excellent',true)?>"/>
					&nbsp;&nbsp;<?php echo $r['Rating']['name']?>
					<script>
					$(function(){ // wait for document to load
						$('.star<?php echo $r['Rating']['id']?>').rating(); 
<?php /*
						 $('.rating_form').submit(function(){
						  $('.test',this).html('');
						  $('input',this).each(function(){
						   if(this.checked) $('.test',this.form).append(''+this.name+': '+this.value+'<br/>');
								});
						  return true;
						 });
*/?>				 
					});
					</script>
					
				
			</li>
			
		<?php }?>
		</ul>
		<?php 
//  		 	echo $this->Recaptcha->show(array('theme' => 'white','lang' => 'en',));	
//  			echo $this->Recaptcha->error();
		?>
 </fieldset>
<button class="submit_button" type="submit"><?php echo __d('competitions','Submit',true)?></button>
<div class="test"></div>
</form>

<div class='clear'>&nbsp;</div>	


